<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<html>
<head>
    <title>企业广告管理管理</title>
    <meta name="decorator" content="default"/>
    <script type="text/javascript">
        $(document).ready(function () {

        });

        function page(n, s) {
            $("#pageNo").val(n);
            $("#pageSize").val(s);
            $("#searchForm").submit();
            return false;
        }

        function getIds() {
            var ids = [];
            $("input[name='ids']:checked").each(function () {
                ids.push({id: $(this).val(), name: $(this).attr("label")});
            });
            return ids;

        }
    </script>
</head>
<body>
<c:if test="${empty hkEnterpriseAdv.checked}">
    <ul class="nav nav-tabs">
        <li class="active"><a href="${ctx}/adv/hkEnterpriseAdv/">企业广告管理列表</a></li>
        <shiro:hasPermission name="adv:hkEnterpriseAdv:edit">
            <li><a href="${ctx}/adv/hkEnterpriseAdv/form">企业广告管理添加</a></li>
        </shiro:hasPermission>
    </ul>
</c:if>
<form:form id="searchForm" modelAttribute="hkEnterpriseAdv" action="${ctx}/adv/hkEnterpriseAdv/" method="post"
           class="breadcrumb form-search">
    <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
    <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
    <ul class="ul-form">
        <li><label>标题：</label>
            <form:input path="title" htmlEscape="false" maxlength="200" class="input-medium"/>
        </li>
        <li><label>状态：</label>
            <form:select path="state" class="input-medium">
                <form:option value="" label=""/>
                <form:options items="${fns:getDictList('yes_no')}" itemLabel="label" itemValue="value"
                              htmlEscape="false"/>
            </form:select>
        </li>
        <li><label>企业名称：</label>
            <form:input path="enterpriseName" htmlEscape="false" maxlength="100" class="input-medium"/>
        </li>
        <li><label>是否评论：</label>
            <form:select path="comment" class="input-medium">
                <form:option value="" label=""/>
                <form:options items="${fns:getDictList('yes_no')}" itemLabel="label" itemValue="value"
                              htmlEscape="false"/>
            </form:select>
        </li>
        <input id="checked" name="checked" type="hidden" value="${hkEnterpriseAdv.checked}"/>
        <li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/></li>
        <li class="clearfix"></li>
    </ul>
</form:form>
<sys:message content="${message}"/>
<table id="contentTable" class="table table-striped table-bordered table-condensed">
    <thead>
    <tr>
        <c:if test="${not empty hkEnterpriseAdv.checked}">
            <th>选择</th>
        </c:if>
        <th>标题</th>
        <th>用户</th>
        <th>图片</th>
        <th>官方标题</th>
        <th>官方图片</th>
        <th>序号</th>
        <th>所属分类</th>
        <th>系统币种</th>
        <th>状态</th>
        <th>国家</th>
        <th>省</th>
        <th>市</th>
        <th>标签</th>
        <th>是否评论</th>
        <th>开始时间</th>
        <th>结束时间</th>
        <th>更新时间</th>
        <th>备注</th>
        <c:if test="${ empty hkEnterpriseAdv.checked}">
            <shiro:hasPermission name="adv:hkEnterpriseAdv:edit">
                <th>操作</th>
            </shiro:hasPermission>
        </c:if>
    </tr>
    </thead>
    <tbody>
    <c:forEach items="${page.list}" var="hkEnterpriseAdv2">
        <tr>
            <c:if test="${not empty hkEnterpriseAdv.checked}">
                <td>
                    <input type="checkbox" name="ids" value="${hkEnterpriseAdv2.id}" label="${hkEnterpriseAdv2.title}">
                </td>
            </c:if>
            <td>
                <c:if test="${not empty hkEnterpriseAdv.checked}">
                    ${hkEnterpriseAdv2.title}
                </c:if>
                <c:if test="${ empty hkEnterpriseAdv.checked}">
                    <a href="${ctx}/adv/hkEnterpriseAdv/form?id=${hkEnterpriseAdv2.id}">
                            ${hkEnterpriseAdv2.title}
                    </a>
                </c:if>
            </td>

            <td>
                    ${hkEnterpriseAdv2.user.name}
            </td>

            <td>
                <img src="${hkEnterpriseAdv2.coverImgSrc}" width="240" height="200"/>
                    <%-- <td>
                         <c:if test="${not empty hkEnterpriseAdv.checked}">
                             ${hkEnterpriseAdv2.title}
                         </c:if>
                         <c:if test="${ empty hkEnterpriseAdv.checked}">
                             <a href="${ctx}/adv/hkEnterpriseAdv/form?id=${hkEnterpriseAdv2.id}">
                                     ${hkEnterpriseAdv2.title}
                             </a>
                         </c:if>


                     </td>
                     <td>
                         <img src="${hkEnterpriseAdv2.coverImgSrc}" width="240" height="200"/>

                     </td>--%>
            <td>
                    ${hkEnterpriseAdv2.officiaTitle}
            </td>
            <td>
                <img src="${hkEnterpriseAdv2.officiaImgSrc}" width="240" height="200"/>
            </td>
            <td>
                    ${hkEnterpriseAdv2.imgRank}
            </td>
                <%-- <td>
                         ${hkEnterpriseAdv2.imgRank}
                 </td>--%>
            <td>
                    ${hkEnterpriseAdv2.category}
            </td>
            <td>
                    ${fns:getDictLabels(hkEnterpriseAdv2.currencyType, 'hk_currency_type', '')}
            </td>
            <td>
                    ${fns:getDictLabel(hkEnterpriseAdv2.state, 'yes_no', '')}
            </td>
            <td>
                    ${hkEnterpriseAdv2.country}
            </td>
            <td>
                    ${hkEnterpriseAdv2.province}
            </td>
            <td>
                    ${hkEnterpriseAdv2.city}
            </td>
            <td>
                    ${fns:getDictLabels(hkEnterpriseAdv2.tag, 'hk_enterprise_adv_tag', '')}
            </td>
            <td>
                    ${fns:getDictLabel(hkEnterpriseAdv2.comment, 'yes_no', '')}
            </td>
            <td>
                <fmt:formatDate value="${hkEnterpriseAdv2.beginDate}" pattern="yyyy-MM-dd"/>
            </td>
            <td>
                <fmt:formatDate value="${hkEnterpriseAdv2.endDate}" pattern="yyyy-MM-dd"/>
            </td>
            <td>
                <fmt:formatDate value="${hkEnterpriseAdv2.updateDate}" pattern="yyyy-MM-dd  HH:mm:ss"/>
            </td>
            <td>
                    ${hkEnterpriseAdv2.remarks}
            </td>
            <c:if test="${ empty hkEnterpriseAdv.checked}">
                <shiro:hasPermission name="adv:hkEnterpriseAdv:edit">
                    <td>
                        <a href="${ctx}/adv/hkEnterpriseAdv/form?id=${hkEnterpriseAdv2.id}">修改</a>
                            <%--<a href="${ctx}/adv/hkEnterpriseAdv/recommend?id=${hkEnterpriseAdv2.id}" onclick="return confirmx('确认要推荐该企业广告吗？', this.href)">设置推荐</a>

                            <a href="${ctx}/adv/hkEnterpriseAdvReward/list?enterprise.id=${hkEnterpriseAdv2.id}">配置奖励</a>--%>
                            <%--<a href="${ctx}/adv/hkEnterpriseAdvIntegralRule/list?enterpriseId=${hkEnterpriseAdv2.id}">基础乐币规则</a>--%>
                        <a href="${ctx}/adv/hkEnterpriseAdv/delete?id=${hkEnterpriseAdv2.id}"
                           onclick="return confirmx('确认要删除该企业广告吗？', this.href)">删除</a>
                    </td>
                </shiro:hasPermission>
            </c:if>
        </tr>
    </c:forEach>
    </tbody>
</table>
<div class="pagination">${page}</div>
</body>
</html>